
import {getCate} from "../../request/api.js"

const state = {
    nav:[]
}

const mutations = {
    changeList(state,arr){
        state.nav = arr
    }
}

const actions = {
    asyncchangelist(context){
        getCate().then(res=>{
            context.commit('changeList', res.data.list)
        })
    }
}

const getters = {
    nav(state){
        return state.nav
    }
}

export default{
    state,
    mutations,
    actions,
    getters,
    namespaced: true
}